package com.hy.hywebview.webviewprocess.webviewclient

import android.graphics.Bitmap
import android.webkit.WebResourceError
import android.webkit.WebResourceRequest
import android.webkit.WebView
import android.webkit.WebViewClient

/**
 * @Description:
 * @Author: wdk
 * @CreateTime: 2024/4/13 17:32
 */
class HYWebViewClient(private val mWebViewCallBack: WebViewCallBack) : WebViewClient() {
    companion object {
        private const val TAG = "HYWebViewClient"
    }

    override fun onPageStarted(view: WebView?, url: String?, favicon: Bitmap?) {
        mWebViewCallBack.pageStarted(url)

    }

    override fun onPageFinished(view: WebView?, url: String?) {
        mWebViewCallBack.pageFinished(url)
    }

    override fun onReceivedError(
        view: WebView?,
        request: WebResourceRequest?,
        error: WebResourceError?
    ) {
        mWebViewCallBack.onError()
    }
}